import request from '@/utils/request';

// 项目列表
export const getTabListAPI = params => {
    return request({
        url: '/api/LcywsyXmgl/GCP_Syxm_getList',
        method: 'get',
        params
    });
};
// 根据申请人获取项目列表
export const getUserTabListAPI = params => {
    return request({
        url: '/api/LcywsyXmgl/GCP_Syxm_getListByUser',
        method: 'get',
        params
    });
};
// 项目编码
export const getItemCodeAPI = xmbm => {
    return request({
        url: '/api/LcywsyXmgl/GCP_Syxm_getDetails',
        method: 'get',
        xmbm
    });
};
// 项目详情
export const getProjectDetailAPI = params => {
    return request({
        url: '/api/LcywsyXmgl/GCP_Syxm_Regist',
        method: 'post',
        params
    });
};
// 项目审核
export const getProjectAuditAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_JDSH?token=${params.token}&xmid=${params.xmid}&xmzt=${params.xmzt}`,
        method: 'post',
        data: params.Params
    });
};
// 项目审核立项得下载
export const getProjectDownAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_DownLoadXMXX`,
        // url:`/api/LcywsyXmgl/GCP_Syxm_DownLoadXMXX?token=${params.token}&xmid=${params.xmid}`,
        method: 'get',
        params
    });
};

export const getStatusChange = params => {
    return request({
        url: '/api/LcywsyXmgl/GCP_Syxm_UpdateState',
        method: 'post',
        params
    });
};
// 专家组列表
export const getSpeciaListAPI = data => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_getZJZ?token=${data.token}&xmid=${data.xmid}`,
        method: 'get',
        data
    });
};
// 受试者信息操作
export const getSubjectSyncAPI = data => {
    return request({
        url: `/api/LcywsyXmgl/GCP_SszzmInfoSync?token=${data.token}&CZLX=${data.CZLX}`,
        method: 'post',
        data: data.Params
    });
};
// 项目列表详情
export const getTabListDetailsAPI = params => {
    return request({
        url: '/api/LcywsyXmgl/GCP_Syxm_getDetails',
        method: 'get',
        params
    });
};
// 添加专家
export const addSpecialAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_SetZJZ?token=${params.token}&xmid=${params.xmid}`,
        method: 'post',
        data: params.Params
    });
};
// 删出专家
export const delUserAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_DelZJZ`,
        // url: `/api/LcywsyXmgl/GCP_Syxm_DelZJZ?token`,
        method: 'get',
        params
    });
};
// 项目申请
export const registProjectAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_Regist?token=${params.token}&xmid=${params.xmid}`,
        method: 'post',
        data: params.Params
    });
};
// 提交改变项目状态getDownListAPI
export const changeStateAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_UpdateState`,
        method: 'post',
        params
    });
};
// 下载中心列表
export const getDownListAPI = params => {
    return request({
        url: '/api/LcywsyXmgl/GCP_DownLoad_getList',
        method: 'get',
        params
    });
};
// 下载中心下载
export const getDownlistDownAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_DownLoad_Load/${params.ID}`,
        method: 'get',
        params
    });
};
// 删出下载中心列表
export const getDownlistDelAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_DownLoad_Del/${params.ID}?token=${params.token}&OPRID=${params.OPRID}&IP=${params.ID}`,
        method: 'get',
        params
    });
};
// 上传文件
export const getUploadListAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_DownLoad_Save?token=${params.token}&lx=${params.lx}&OprID=${params.OprID}&ip=${params.ip}`,
        method: 'post',
        data: params.ImportFile
    });
};
// 获取角色列表
export const getRoleListAPI = params => {
    return request({
        url: `/api/Login/cpisApi_GetRoleList`,
        method: 'get',
        params
    });
};
// 操作角色（添加和删除）
export function roleSyncAPI(params) {
    return request({
        url: `/api/Login/cpisApi_RoleSync`,
        method: 'post',
        params
    });
}
// 获取人员管理列表
export const getPersonnelAPI = params => {
    return request({
        url: `/api/Login/cpisApi_GetRegisteredUserList`,
        method: 'get',
        params
    });
};

// 添加人员管理列表
export const addPersonnelAPI = params => {
    return request({
        url: `/api/Login/cpisApi_Register_GCP`,
        method: 'post',
        data: params.Params
    });
};
// 编辑人员管理列表
export const editPersonnelAPI = params => {
    return request({
        url: `/api/Login/GCP_UpdateRegisterInfo?token=${params.token}`,
        method: 'post',
        data: params.Params
    });
};
// 删除人员管理列表
export const delPersonnelAPI = params => {
    return request({
        url: `/api/Login/cpisApi_DelPersonInfo`,
        method: 'post',
        params
    });
};
// 人员的启用停用
export function updateUserStateAPI(params) {
    return request({
        url: `/api/Login/cpisApi_UpdateRegisteredState`,
        method: 'post',
        params
    });
}
// 获取功能列表
export const getMenuListAPI = () => {
    return request({
        url: `/api/Login/cpisApi_GetSyscodeList`,
        method: 'get'
    });
};
// 角色分配页面
export const getRolePageAPI = params => {
    return request({
        url: `/api/Login/cpisApi_AddRoleSyscode?token=${params.token}&OprID=${params.OprID}`,
        method: 'post',
        data: params.Params
    });
};
// 人员分配角色
export const getRoleChoseAPI = params => {
    return request({
        url: `/api/Login/cpisApi_AddOprRole`,
        method: 'post',
        params
    });
};
// 角色获取列表
export const getRoleMenuListAPI = params => {
    return request({
        url: `/api/Login/cpisApi_GetFuncByUserID`,
        method: 'get',
        params
    });
};
// 获取项目资料
export const getProjectList = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_getDataList`,
        method: 'get',
        params
    });
};
// 项目资料上传
export const getProjectUpload = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_DataUpload?token=${params.token}&oprid=${params.oprid}&xmid=${params.xmid}&xmjd=${params.xmjd}`,
        method: 'post',
        data: params.ImportImage
    });
};
// 项目资料下载
export const getProjectDownLoad = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_DownLoad`,
        method: 'get',
        params
    });
};
// 删除项目资料
export const delProjectList = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_deleteData`,
        method: 'post',
        params
    });
};
// 点击申请新项目
export const applyNewProgectAPI = params => {
    return request({
        url: `/api/LcywsyXmgl/GCP_Syxm_SQ`,
        method: 'post',
        params
    });
};
// 机构管理列表
export const getOrganizationAPI = params => {
    return request({
        url: `/api/JCXX/cpisAPI_GetOrgList`,
        method: 'get',
        params
    });
};
// 机构管理列表增删改
export function orgSyncAPI(params) {
    return request({
        url: `/api/JCXX/cpisAPI_OrgSync?token=${params.token}&OprID=${params.OprID}&CZLX=${params.CZLX}`,
        method: 'post',
        data: params.Params
    });
}
// 机构分配角色
export function getOrgRoleAPI(params) {
    return request({
        url: `/api/Login/cpisApi_AddOrgRole`,
        method: 'post',
        params
    });
}
// 用户登陆记录
export function getLogAPI(params) {
    return request({
        url: `/api/JCXX/cpisAPI_RZList`,
        method: 'post',
        params
    });
}
